import { environment } from 'src/environments/environment';
import { HttpClient, HttpHeaders } from '@angular/common/http';
export class BaseService {
  public constructor(private http: HttpClient) {}

  protected post<T>(url, body) {
    return this.http.post<T>(`${environment.baseUrl}${url}`, body, {
      headers: new HttpHeaders().set('Content-Type', 'application/json'),
      responseType: 'json',
    });
  }
  protected get<T>(url) {
    return this.http.get<T>(`${environment.baseUrl}${url}`, {
      headers: new HttpHeaders().set('Content-Type', 'application/json'),
      responseType: 'json',
    });
  }
}
